package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.util.ApplicablePlatformEnum;
import com.frogs.system.util.OpenPlatformEnum;
import com.frogs.system.web.api.request.Request;

/**
 * 开发平台登录请求参数类
 *
 * @author lijian
 * @version 2014年6月30日 - 上午9:45:31
 */
public class OpenPlatformLoginRequest extends Request {
	
	private String code;
	
	private String openId;
	
	private Integer openPlatformId;
	
	private String ip;

	@Override
	public void parse(HttpServletRequest request) {
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		this.code = requestInfo.getParameter(ApiUrlParamEnum.code.getParamName(), "");
		this.openId = requestInfo.getParameter(ApiUrlParamEnum.openId.getParamName(), "");
		this.openPlatformId = requestInfo.getIntParameter(ApiUrlParamEnum.openPlatformId.getParamName(), 0);
		this.ip = requestInfo.getParameter(ApiUrlParamEnum.ip.getParamName(), requestInfo.getUserIp());
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public Integer getOpenPlatformId() {
		return openPlatformId;
	}

	public void setOpenPlatformId(Integer openPlatformId) {
		this.openPlatformId = openPlatformId;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

}
